<?php

namespace app\admin\validate;

use think\Validate;

class WorkTemplate extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require|max:255',
        'type' => 'integer|gt:0',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'name.require' => '模板名称不能为空',
        'name.max' => '模板名称填入过长',
        'type.integer' => '请选择类型',
        'type.gt' => '请选择类型',
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name', 'type'],
        'edit' => ['name', 'type'],
    ];



}
